---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: d8:monitoring-kubernetes:node-exporter
  {{- include "helm_lib_module_labels" (list . (dict "app" "node-exporter")) | nindent 2 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: d8:monitoring-kubernetes:node-exporter
subjects:
- kind: ServiceAccount
  name: node-exporter
  namespace: d8-monitoring
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: d8:monitoring-kubernetes:node-exporter
  {{- include "helm_lib_module_labels" (list . (dict "app" "node-exporter")) | nindent 2 }}
rules:
- apiGroups: [""]
  resources:
  - nodes
  - nodes/proxy
  verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: d8:monitoring-kubernetes:node-exporter:rbac-proxy
  {{- include "helm_lib_module_labels" (list . (dict "app" "node-exporter")) | nindent 2 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: d8:rbac-proxy
subjects:
- kind: ServiceAccount
  name: node-exporter
  namespace: d8-monitoring
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: node-exporter
  namespace: d8-monitoring
  {{- include "helm_lib_module_labels" (list . (dict "app" "node-exporter")) | nindent 2 }}
